

define([], function(){

    const  { html, Component, linkState } = preact;
  
    class Index extends Component {
        constructor(props){
            super(props);
            this.state = {
                dialogMyAwardVisible : false,
            }
        }
        componentDidMount(){

        }
        render(props, state){

            console.log('main=>props:', props);

            const gotoHref = (path)=>{
                props.history.push(path)
            }

            return html`<div class="page-index">
            <h1>hello world!</h1>
            <ul>
                <li>
                <a href="javascript:void(0);" onClick=${()=>{
                    gotoHref('/demo');
                    return false;
                }}>进入demo页</a>
                </li>
                <li>
                <a href="javascript:void(0);" onClick=${()=>{
                    gotoHref('/game');
                    return false;
                }}>进入游戏页</a>
                </li>
                <li>
                <a href="javascript:void(0);" onClick=${()=>{
                    gotoHref('/favs');
                    return false;
                }}>收藏页</a>
                </li>
                <li>
                <a href="javascript:void(0);" onClick=${()=>{
                    gotoHref('/mycards');
                    return false;
                }}>我的卡片</a>
                </li>
            </ul>
            </div>`;
        }
    }

    return Index;
});